package com.gupao.javavip.rpc.client;

import com.gupao.javavip.rpc.api.IUserService;
import com.gupao.javavip.rpc.api.dto.AddUserRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserServiceClient {
    @Autowired
    private IUserService userService;

    public void addUser() {
        AddUserRequest request = new AddUserRequest();
        request.setName("King");
        request.setAge("32");

        Long id = userService.addUser(request);
        System.out.println("RPC调用结果：" + id);
    }

    public void sayHello() {
        userService.sayHello();
    }
}
